@extends("admin.frame_layout")
<?php $top_selected = "工作台";
if ($flag == 0) {
    $page_menu = "待处理提现";
} elseif ($flag == 1) {
    $page_menu = "已打款提现记录";
} elseif ($flag == 2) {
    $page_menu = "已拒绝提现记录";
}
?>
@section('content')
    <div class="rightinfo">
        <div class="tools">
            <form method="get" id="sform" action="{{route('admin.withdraw',['flag'=>$flag])}}">
                <ul class="toolbar">
                    <li>
                        <input type="text" name="start" placeholder="开始时间"
                               onClick="laydate({istime: true,format: 'YYYY-MM-DD hh:mm:ss'})">
                    </li>
                    <li>
                        <input type="text" name="end" placeholder="结束时间"
                               onClick="laydate({istime: true,format: 'YYYY-MM-DD hh:mm:ss'})">
                    </li>
                    <li>
                        <select name="search_type">
                            <option value="2">提现申请编号</option>
                            <option value="1">用户帐号</option>
                            <option value="3">用户ID</option>
                        </select>
                    </li>
                    <li>
                        <input id="search_str" name="search_str" type="text" placeholder="搜索条件">
                    </li>
                    <li>
                        <a href="javascript:void(0)" onclick="$('#sform').submit()">
                            <span><img src="{{asset('admin/imgs/ico06.png')}}" width="20px"
                                       height="20px"/></span>搜索
                        </a>
                    </li>
                </ul>
            </form>
        </div>

        <table class="tablelist">
            <thead>
            <tr>
                <th width="70px">操作</th>
                <th width="80px">ID<i class="sort"><img src="{{asset('admin/imgs/px.gif')}}"/></i></th>
                <th width="100px">编号<i class="sort"><img src="{{asset('admin/imgs/px.gif')}}"/></i></th>
                <th>用户名</th>
                <th>钱包类型</th>
                <th>提现金额</th>
                <th>手续费</th>
                <th>到账金额</th>
                <th>提现方式</th>
                <th style="text-align: left;">收款地址</th>
                <th>状态</th>
                <th style="text-align: left;">备注</th>
                <th width="150px">申请时间</th>
            </tr>
            </thead>
            <tbody>
            @foreach($withdraws as $log)
                <tr>
                    <td class="act" bind="#{{$log->id}}">
                        <img src="{{asset('admin/imgs/t05.png')}}"/>菜单
                        @if($flag == 0)
                            <ul id="{{$log->id}}">
                                <li onclick="openAllowDlg({{$log->id}})">
                                    <img src="{{asset('admin/imgs/d02.png')}}"/>通过审核
                                </li>
                                <li onclick="openDenyDlg({{$log->id}})">
                                    <img src="{{asset('admin/imgs/d02.png')}}"/>拒绝提现请求
                                </li>
                            </ul>
                        @endif
                    </td>
                    <td>{{$log->id}}</td>
                    <td>{{$log->no}}</td>
                    <td>{{$log->username}}</td>
                    <td>
                        @if($log->wallet == \App\Models\MWallet::$WALLET_TYPE_1)
                            奖金币
                        @elseif($log->wallet == \App\Models\MWallet::$WALLET_TYPE_2)
                            报单币
                        @elseif($log->wallet == \App\Models\MWallet::$WALLET_TYPE_3)
                            购物币
                        @endif
                    </td>
                    <td>{{$log->money}}</td>
                    <td>{{$log->tax_money}}</td>
                    <td class="red">{{$log->ok_money}}</td>
                    <td>{{uPayWayStr($log->type)}}</td>
                    <td class="text-left">
                        @if ($log->type == \App\Models\MWithdrawLog::$PAY_TYPE_ZFB)
                            {{"账号：" . $log->zfb . " 手机：" . $log->tel}}
                        @elseif ($log->type == \App\Models\MWithdrawLog::$PAY_TYPE_WX)
                            {{"账号：" . $log->wx . " 手机：" . $log->tel}}
                        @elseif ($log->type == \App\Models\MWithdrawLog::$PAY_TYPE_YHK)
                            {{$log->card_bank . " " . $log->card_no . " " . $log->card_name. " " . $log->tel}}
                        @endif
                    </td>
                    <td>
                        @if($log->status == \App\Models\MWithdrawLog::$STATUS_WAIT)
                            <span class="red">待审核</span>
                        @elseif($log->status == \App\Models\MWithdrawLog::$STATUS_DENY)
                            <span class="red">已拒绝</span>
                        @elseif($log->status == \App\Models\MWithdrawLog::$STATUS_SUCCESS)
                            <span class="green">已打款</span>
                        @endif
                    </td>
                    <td class="text-left">{{$log->result or "无"}}</td>
                    <td>{{date("Y-m-d H:i:s",$log->create_time)}}</td>
                </tr>
            @endforeach
            </tbody>
        </table>
        @include('admin.coms.fenye')
    </div>
    @include('admin.coms.allow-dialog')
    @include('admin.coms.deny-dialog')
@endsection
@section('footer')
    <script src="{{asset('admin/js/laydate/laydate.js')}}"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            laydate.skin("dahong"); //大红色日期选择皮肤
            //初始化表格操作菜单
            $('.tablelist tbody tr:odd').addClass('odd');
            $(".tablelist .act").hover(function () {
                $($(this).attr("bind")).show();
            }, function () {
                $($(this).attr("bind")).hide();
            });
        });
    </script>
@endsection

